package org.nanotek.service;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;

import org.nanotek.beans.ArtistName;
import org.nanotek.dao.impl.ArtistDAOLocal;

@Stateless
@TransactionManagement(TransactionManagementType.CONTAINER)
public class ArtistServiceImpl implements ArtistService {

	@EJB 
	ArtistDAOLocal artistDAO;
	
	@Override
	public ArtistName findArtist(String code) {
		ArtistName name = new ArtistName();
		Long id = new Long(code);
		name.setId(id);
		return artistDAO.find(name);
	}

	@Override
	public List<?> loadArtistList(Integer startRecord, Integer numRecords) {
		return artistDAO.listRecords(startRecord, numRecords);
	}

}
